import React from 'react';
import { Card } from 'antd';
import * as echarts from 'echarts';

const Statistics: React.FC = () => {
  React.useEffect(() => {
    const chartDom = document.getElementById('statistics-chart');
    if (chartDom) {
      const myChart = echarts.init(chartDom);
      const option = {
        // ECharts配置项
        title: {
          text: '项目验收统计'
        },
        tooltip: {},
        xAxis: {
          data: ['预验收', '正式验收', '整改中', '已完成']
        },
        yAxis: {},
        series: [{
          name: '数量',
          type: 'bar',
          data: [45, 38, 29, 85]
        }]
      };
      myChart.setOption(option);
    }
  }, []);

  return (
    <div id="statistics-chart" style={{ height: '300px' }} />
  );
};

export default Statistics; 